package com.tbsoft.ehr.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 合同信息对象
 * @author lizhenhua
 *
 */

@Entity
@Table(name="EHR_CONTRACT")
public class Contract extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 自动生成的合同主键
	 */
	private String id;
	
	/**
	 * 合同开始时间
	 */
	private Date startTime;
	
	/**
	 * 合同截止时间
	 */
	private Date endTime;
	
	/**
	 * 合同描述
	 */
	private String desc;	
	
	/**
	 * 档案信息
	 */
	private StaffInfo staff;
		
	public Contract(){}
	
	public Contract(String id){
		this.id = id;
	}

	@Id
	@GeneratedValue(generator="system-uuid")
	@GenericGenerator(name="system-uuid", strategy = "uuid")
	@Column(name="CONTRACT_ID")
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name="START_TIME",columnDefinition="datetime")
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@Column(name="END_TIME",columnDefinition="datetime")
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@Column(name="CONTRACT_DESC",length=250)
	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	@ManyToOne
	@JoinColumn(name="STAFF_ID")
	public StaffInfo getStaff() {
		return staff;
	}

	public void setStaff(StaffInfo staff) {
		this.staff = staff;
	}

	
}
